package com.just.recruitback.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.just.recruitback.entity.Company;
import com.just.recruitback.model.PageInfo;
import com.just.recruitback.service.CompanyService;
import com.just.recruitback.service.base.ICompanyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author : baibaiwucahng
 * @date : 2020/7/3  22:41
 */
@Service
public class CompanyServiceImpl implements CompanyService {
    @Resource
    private ICompanyService iCompanyService;

    @Override
    public Page<Company> pageCompany(String name, PageInfo pageInfo) {
        QueryWrapper<Company> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("name", name);
        Page<Company> companyPage = new Page<>(pageInfo.getCount(), pageInfo.getSize());
        return iCompanyService.page(companyPage, queryWrapper);
    }

    @Override
    public Company getOne(int id) {
        return iCompanyService.getById(id);
    }
}
